<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>DWGIFManager Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">bokecc </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">com.bokecc</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/completeBlock">completeBlock</option>
		
		<option value="//api/name/isRecording">isRecording</option>
		
		<option value="//api/name/loopCount">loopCount</option>
		
		<option value="//api/name/quality">quality</option>
		
	</optgroup>
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/associationWithUrl:CurrentPlayer:AndUseM3U8Method:">- associationWithUrl:CurrentPlayer:AndUseM3U8Method:</option>
		
		<option value="//api/name/cancelRecordGif">- cancelRecordGif</option>
		
		<option value="//api/name/createGIFfromURL:loopCount:delayTime:gifImagePath:complete:">- createGIFfromURL:loopCount:delayTime:gifImagePath:complete:</option>
		
		<option value="//api/name/createGIFfromURL:withFrameCount:delayTime:loopCount:gifImagePath:complete:">- createGIFfromURL:withFrameCount:delayTime:loopCount:gifImagePath:complete:</option>
		
		<option value="//api/name/endRecordingGif">- endRecordingGif</option>
		
		<option value="//api/name/getMediaDurationWithMediaUrl:">- getMediaDurationWithMediaUrl:</option>
		
		<option value="//api/name/interceptVideoAndVideoUrl:withOutPath:outputFileType:range:intercept:">- interceptVideoAndVideoUrl:withOutPath:outputFileType:range:intercept:</option>
		
		<option value="//api/name/startRecordingGif">- startRecordingGif</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">DWGIFManager Class Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Inherits from</th>
	<td>NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>DWGIFManager.h<br />DWGIFManager.m</td>
</tr>
						</tbody></table></div>
					

                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>注释：
因为m3u8格式 无法通过AVURLAsset 截取视频流， 所以对m3u8的视频格式使用AVPlayerItemVideoOutput 截图，来生成GIF</p>
					</div>
					
					

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/completeBlock" title="completeBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/completeBlock">&nbsp;&nbsp;completeBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>制作完成GIF回调</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, copy) CompleteBlock completeBlock</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>制作完成GIF回调</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/quality" title="quality"></a>
	<h3 class="method-title"><code><a href="#//api/name/quality">&nbsp;&nbsp;quality</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>生成GIF质量</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) GIFQuality quality</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>生成GIF质量</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/loopCount" title="loopCount"></a>
	<h3 class="method-title"><code><a href="#//api/name/loopCount">&nbsp;&nbsp;loopCount</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>GIF播放的次数  0无限循环</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) NSInteger loopCount</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>GIF播放的次数  0无限循环</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/isRecording" title="isRecording"></a>
	<h3 class="method-title"><code><a href="#//api/name/isRecording">&nbsp;&nbsp;isRecording</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>是否正在录制gif</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) BOOL isRecording</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>是否正在录制gif</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/associationWithUrl:CurrentPlayer:AndUseM3U8Method:" title="associationWithUrl:CurrentPlayer:AndUseM3U8Method:"></a>
	<h3 class="method-title"><code><a href="#//api/name/associationWithUrl:CurrentPlayer:AndUseM3U8Method:">&ndash;&nbsp;associationWithUrl:CurrentPlayer:AndUseM3U8Method:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>关联播放器，startRecordingGif录制开始前调用     !!!在每次startRecordingGif前，都要调用此方法</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)associationWithUrl:(NSURL *)<em>playUrl</em> CurrentPlayer:(AVPlayer *)<em>currentPlayer</em> AndUseM3U8Method:(BOOL)<em>m3u8Method</em></code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li><p>关联播放器，startRecordingGif录制开始前调用     !!!在每次startRecordingGif前，都要调用此方法</p></li>
<li><p>@param <a href="#//api/name/playUrl">playUrl</a>                 播放路径</p></li>
<li>@param currentPlayer           当前播放<a href="#//api/name/player">player</a></li>
<li>@param m3u8Method              为YES，会强制使用m3u8视频格式截取GIF方式，一般设置为NO即可</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/startRecordingGif" title="startRecordingGif"></a>
	<h3 class="method-title"><code><a href="#//api/name/startRecordingGif">&ndash;&nbsp;startRecordingGif</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>开始录制gif</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)startRecordingGif</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>开始录制gif</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/endRecordingGif" title="endRecordingGif"></a>
	<h3 class="method-title"><code><a href="#//api/name/endRecordingGif">&ndash;&nbsp;endRecordingGif</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>结束录制gif                如果视频播放完成，内部会自动调用此方法，完成GIF回调</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)endRecordingGif</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>结束录制gif                如果视频播放完成，内部会自动调用此方法，完成GIF回调</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/cancelRecordGif" title="cancelRecordGif"></a>
	<h3 class="method-title"><code><a href="#//api/name/cancelRecordGif">&ndash;&nbsp;cancelRecordGif</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>取消录制gif</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)cancelRecordGif</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>取消录制gif</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/interceptVideoAndVideoUrl:withOutPath:outputFileType:range:intercept:" title="interceptVideoAndVideoUrl:withOutPath:outputFileType:range:intercept:"></a>
	<h3 class="method-title"><code><a href="#//api/name/interceptVideoAndVideoUrl:withOutPath:outputFileType:range:intercept:">&ndash;&nbsp;interceptVideoAndVideoUrl:withOutPath:outputFileType:range:intercept:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>视频的URL</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)interceptVideoAndVideoUrl:(NSURL *)<em>videoUrl</em> withOutPath:(NSString *)<em>outPath</em> outputFileType:(NSString *)<em>outputFileType</em> range:(NSRange)<em>videoRange</em> intercept:(InterceptBlock)<em>interceptBlock</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>videoUrl</code></th>
						<td><p>视频的URL</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>outPath</code></th>
						<td><p>输出路径</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>outputFileType</code></th>
						<td><p>输出视频格式</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>videoRange</code></th>
						<td><p>截取视频的范围</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>completeBlock</code></th>
						<td><p>视频截取的回调</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/getMediaDurationWithMediaUrl:" title="getMediaDurationWithMediaUrl:"></a>
	<h3 class="method-title"><code><a href="#//api/name/getMediaDurationWithMediaUrl:">&ndash;&nbsp;getMediaDurationWithMediaUrl:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>URL字符串</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (CGFloat)getMediaDurationWithMediaUrl:(NSString *)<em>mediaUrlStr</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>mediaUrlStr</code></th>
						<td><p>URL字符串</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>返回视频时长</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/createGIFfromURL:loopCount:delayTime:gifImagePath:complete:" title="createGIFfromURL:loopCount:delayTime:gifImagePath:complete:"></a>
	<h3 class="method-title"><code><a href="#//api/name/createGIFfromURL:loopCount:delayTime:gifImagePath:complete:">&ndash;&nbsp;createGIFfromURL:loopCount:delayTime:gifImagePath:complete:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>生成GIF图片</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)createGIFfromURL:(NSURL *)<em>videoURL</em> loopCount:(int)<em>loopCount</em> delayTime:(CGFloat)<em>time</em> gifImagePath:(NSString *)<em>imagePath</em> complete:(CompleteBlock)<em>completeBlock</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>videoURL</code></th>
						<td><p>视频的路径URL</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>loopCount</code></th>
						<td><p>播放次数</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>time</code></th>
						<td><p>每帧的时间间隔 默认0.25s</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>imagePath</code></th>
						<td><p>存放GIF图片的文件路径</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>completeBlock</code></th>
						<td><p>完成的回调</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>生成GIF图片</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/createGIFfromURL:withFrameCount:delayTime:loopCount:gifImagePath:complete:" title="createGIFfromURL:withFrameCount:delayTime:loopCount:gifImagePath:complete:"></a>
	<h3 class="method-title"><code><a href="#//api/name/createGIFfromURL:withFrameCount:delayTime:loopCount:gifImagePath:complete:">&ndash;&nbsp;createGIFfromURL:withFrameCount:delayTime:loopCount:gifImagePath:complete:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>生成GIF图片</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)createGIFfromURL:(NSURL *)<em>videoURL</em> withFrameCount:(int)<em>frameCount</em> delayTime:(CGFloat)<em>time</em> loopCount:(int)<em>loopCount</em> gifImagePath:(NSString *)<em>imagePath</em> complete:(CompleteBlock)<em>completeBlock</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>videoURL</code></th>
						<td><p>视频的路径URL</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>frameCount</code></th>
						<td><p>视频的总时长乘以固定数值 如：视频总时长*4</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>time</code></th>
						<td><p>每帧的时间间隔</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>loopCount</code></th>
						<td><p>播放次数</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>imagePath</code></th>
						<td><p>存放GIF图片的文件路径</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>completeBlock</code></th>
						<td><p>完成的回调</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>生成GIF图片</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWGIFManager.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-07-14</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>